<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        const someAsyncThing = function() {
        return new Promise(function(resolve, reject) {
            // 下面一行会报错，因为x没有声明
            resolve(x + 2);
        });
        };

        someAsyncThing().then(function() {
        return someOtherAsyncThing();
        }).catch(function(error) {
        console.log('oh no', error);
        // 下面一行会报错，因为 y 没有声明
        y + 2;
        }).then(function() {
        console.log('carry on');
        });
        console.log(Promise)
    </script>
</body>
</html>